const chalk = require("chalk");
const getRandomIntInclusive = (min, max) => {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1) + min);
};
exports.createColorsLog = str => {
    let colorArray = [
        "black",
        "red",
        "green",
        "yellow",
        "blue",
        "magenta",
        "cyan",
        "white",
        "gray",
        "redBright",
        "greenBright",
        "yellowBright",
        "blueBright",
        "magentaBright",
        "cyanBright",
        "whiteBright",
    ];
    let logStr = "";
    str.split("").forEach(item => {
        let commond = chalk[colorArray[getRandomIntInclusive(0, 15)]];
        logStr += commond(item);
    });
    return logStr;
};
exports.createRgbLog = str => {
    let logStr = "";
    str.split("").forEach(item => {
        let commond = chalk.rgb(getRandomIntInclusive(0, 255), getRandomIntInclusive(0, 255), getRandomIntInclusive(0, 255));
        logStr += commond(item);
    });
    return logStr;
};
exports.createRandomNumCode = len => {
    // Math.floor(Math.random() * (max - min + 1)) + min
    return (Math.floor(Math.random() * (10 ** len - 1 - 0 + 1)) + 0).toString().padStart(len, "0");
};
